import {REDIRECT_ROUTE_NAME} from "@/router/constants";
import { DEFAULT_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';


const LIST: AppRouteRecordRaw[] = [
  {
    path: '/redirect',
    name: 'redirectWrapper',
    component: DEFAULT_LAYOUT,
    meta: {
      requiresAuth: false,
      hideInMenu: true,
      noAffix:true
    },
    children: [
      {
        path: '/redirect/:path',
        name: REDIRECT_ROUTE_NAME,
        component: () => import('@/views/redirect/index.vue'),
        meta: {
          requiresAuth: false,
          hideInMenu: true,
          noAffix:true
        },
      },
    ],
  },
  {
    path: '/:pathMatch(.*)*',
    name: 'notFound',
    component: () => import('@/views/not-found/index.vue'),
  },
  {
    path: '/exception',
    name: 'exception',
    component: DEFAULT_LAYOUT,
    meta: {
      locale: 'menu.exception',
      requiresAuth: true,
      icon: 'icon-exclamation-circle',
      order: 6,
    },
    children: [
      {
        path: '403',
        name: '403',
        component: () => import('@/views/exception/403/index.vue'),
        meta: {
          locale: 'menu.exception.403',
          requiresAuth: true,
          roles: ['admin'],
        },
      },
      {
        path: '404',
        name: '404',
        component: () => import('@/views/exception/404/index.vue'),
        meta: {
          locale: 'menu.exception.404',
          requiresAuth: true,
          roles: ['*'],
        },
      },
      {
        path: '500',
        name: '500',
        component: () => import('@/views/exception/500/index.vue'),
        meta: {
          locale: 'menu.exception.500',
          requiresAuth: true,
          roles: ['*'],
        },
      },
    ],
  },
  {
    path: '/result',
    name: 'result',
    component: DEFAULT_LAYOUT,
    meta: {
      locale: 'menu.result',
      icon: 'icon-check-circle',
      requiresAuth: true,
      order: 5,
    },
    children: [
      {
        path: 'success',
        name: 'Success',
        component: () => import('@/views/result/success/index.vue'),
        meta: {
          locale: 'menu.result.success',
          requiresAuth: true,
          roles: ['admin'],
        },
      },
      {
        path: 'error',
        name: 'Error',
        component: () => import('@/views/result/error/index.vue'),
        meta: {
          locale: 'menu.result.error',
          requiresAuth: true,
          roles: ['admin'],
        },
      },
    ],
  }
]
export default LIST;
